package site.xuqing.app;

import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;
import site.xuqing.appbus.AppBus;
import site.xuqing.appbus.Client;
import site.xuqing.appbus.listener.OnMsgListener;

public class MainActivity extends AppCompatActivity {
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        Test test = new Test();
        
        Client client = AppBus.getInstance().register(this).sendAll("bundle");
        client.setOnMsgListener(new OnMsgListener<String>() {
            @Override
            public void onMsg(String data) {
                System.out.println("Activity:" + data);
            }
        });
    }
}